package com.cxdr.awsips.analysis.utils;
import java.io.File;

import org.apache.log4j.Logger;

/* 文件进行备份
 * 将文件备份到指定目录
 * */
public class BakFile {
	private static Logger logger = com.cxdr.awsips.analysis.logger.LogFactory.makeNewLogger(BakFile.class);
	
    public void bakFile(File file,String path) {
        try {
           File filePath = new File(path);
           boolean bakFileSuccess=file.renameTo(filePath);
           if (bakFileSuccess) {
               logger.debug("备份解析过的文件：" + file.getPath() + "成功");
           } else {
               logger.warn("备份解析过的文件：" + file.getPath() + "失败");
           }
        } catch (Exception e) {
            logger.error("备份文件异常", e);
        }
    }
}
